package main

import (
	"bufio"
	"fmt"
	"net"
	"os"
)

func main() {

	dial, err := net.Dial("tcp", "192.168.0.103:8888")
	if err != nil {
		fmt.Println("client err", err)
		return
	}
	//控制台标准输入
	reader := bufio.NewReader(os.Stdin)
	readString, err := reader.ReadString('\n')
	if err != nil {
		fmt.Println("read err", err)
	}

	write, err := dial.Write([]byte(readString))
	if err != nil {
		fmt.Println("write err", err)
	}
	fmt.Printf("客户端发送了 %d 字节数据", write)

}
